Skip to content

Add notes to jerry_create_undefined #4790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

matedabis
Copy link
Contributor

No description provided.

@@ -8176,6 +8176,11 @@ main (void)

Creates a `jerry_value_t` representing an undefined value.

*Notes*:
- Calling [jerry_release_value](#jerry_release_value) is optional.
- Calling [jerry_acquire_value](#jerry_acquire_value) is optional.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would write something like this:
The undefined value is a fixed constant. Its value can be copied any number of times without calling jerry_acquire_value, and freeing it with jerry_release_value is optional.

This is also true for true/false/null values, so add this comment to them.

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Break these comments into two lines, they are too long.
Please also rewrite the commit message as well.

@@ -6870,6 +6870,9 @@ jerry_create_shared_arraybuffer_external (const jerry_length_t size

Create a jerry_value_t representing a boolean value from the given boolean parameter.

*Notes*:
- The undefined value is a fixed constant. Its value can be copied any number of times without calling [jerry_acquire_value](#jerry_acquire_value), and freeing it with [jerry_release_value](#jerry_release_value) is optional.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined value -> boolean values (true/false)

@@ -7238,6 +7241,9 @@ jerry_create_number_nan (void);

Creates and returns a `jerry_value_t` with type null object.

*Notes*:
- The undefined value is a fixed constant. Its value can be copied any number of times without calling [jerry_acquire_value](#jerry_acquire_value), and freeing it with [jerry_release_value](#jerry_release_value) is optional.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined ->null

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only a minor change needed

@@ -6870,6 +6870,10 @@ jerry_create_shared_arraybuffer_external (const jerry_length_t size

Create a jerry_value_t representing a boolean value from the given boolean parameter.

*Notes*:
- The boolean values (true/false) are fixed constants. Its value can be copied any number of times without calling
Copy link
Member

@zherczeg zherczeg Oct 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its value -> Their values

…te_boolean

JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@galpeter galpeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@zherczeg zherczeg merged commit f6eac3a into jerryscript-project:master Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants